<?php
/* Job Test cases generated on: 2010-11-16 11:11:26 : 1289902886*/
App::import('Model', 'Job');

class JobTestCase extends CakeTestCase {
	var $fixtures = array('app.message', 'app.user', 'app.group', 'app.contractor_profile', 'app.designer_profile', 'app.comment', 'app.design', 'app.pitch', 'app.pitch_subscription', 'app.design_photo', 'app.job');

	function startTest() {
		$this->Job =& ClassRegistry::init('Job');
		$_SESSION['Auth']['User']['id'] = 2;
		$_SESSION['Auth']['User']['group_id'] = 2;
	}

	function endTest() {
		unset($this->Job);
		ClassRegistry::flush();
		unset($_SESSION['Auth']['User']['id']);
		unset($_SESSION['Auth']['User']['group_id']);
	}
	
	function testGetJob() {
		$result = count($this->Job->get_jobs());
		$expected = 2;
		$this->assertEqual($result, $expected);
		
		$_SESSION['Auth']['User']['id'] = 8;
		$_SESSION['Auth']['User']['group_id'] = 1;
		$result = count($this->Job->get_jobs());
		$expected = 3;
		$this->assertEqual($result, $expected);
	}
	
	function testViewJob(){
		$result = count($this->Job->view_job(1));
		$expected = 3;
		$this->assertEqual($result, $expected);
		
		$result = $this->Job->view_job();
		$this->assertFalse($result);
	}

}
?>
